/**
* @author: thon.ju
* @date: 2013/10/22
* @description: sand compress
**/

var fs = require('fs');
var compressor = require('./compressor');

var $CONFIG = {
  packagePath: process.argv[2],
  basePath: process.argv[2].substr(0, process.argv[2].lastIndexOf('\\')),
  fileList: null
}

fs.readFile($CONFIG.packagePath, 'utf-8', function(err, data){
  var fileObj;
  if(err) {console.log(data); return;}
  fileObj = JSON.parse(data);
  $CONFIG.fileList = fileObj.files;
  compressor($CONFIG);
});